<%--
    Document   : search
    Created on : 2009-11-20, 11:55:45
    Author     : kossel
--%>

<%--Jquery Functions--%>
    <code>
        <script src="../js/jquery-1.3.2.js" type="text/javascript"></script>
        <%--Plugin Alerts--%>
            <code>
                 <script src="../js/jquery.alerts.js" type="text/javascript"></script>
                 <link href="../css/jquery.alerts.css" rel="stylesheet" type="text/css" />
            </code>
        <%--End Plugin Alerts--%>
        <%--Load Carrera--%>
            <code>                
                <script type="text/javascript" charset="utf-8">                        
                        $(document).ready(function() {
                            $("#majorForm").submit(function(){
                                $.post("addCareer.do", $(this).serialize(), function(response){
                                    if(response=="success"){
                                    var majorKey=$("#MajorKey").val();
                                    var majorName=$("#majorName").val();
                                    $("#curriculum").append('<option value="'+majorKey+'">'+majorName+'</option>');
                                    jAlert("Se agrego una carrera exitosamente", "Carrera")
                                    }else   jAlert(response, "Error");
                                }, "html");
                                return false;
                            });
                            $("#curriculumForm").submit(function(){
                                $.post("addCurriculum.do", $(this).serialize(), function(response){
                                    if(response=="success"){
                                    jAlert("Se agrego un plan de estudio exitosamente", "Plan de estudio")
                                    }else   jAlert(response, "Error");
                                }, "html");
                                return false;
                            });


                        } );                        
                </script>
            </code>
        <!--End Load Carrera-->
    </code>
<%--End Jquery Functions--%>

<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>

<html:errors/>
<html:form action="/adminMajor/addCareer" styleId="majorForm">

    <table class="fields">
         <tr>
            <td align="right"><bean:message key="label.career.key"/>:</td>
            <td><html:text property="majorKey" styleId="MajorKey" /> </td>
        </tr>
        <tr>
            <td align="right"><bean:message key="label.career.careerName"/>:</td>
            <td><html:text property="majorName" styleId="majorName" /> </td>
        </tr>
        <tr>
            <td></td>
            <td><html:submit titleKey="label.button.add"/></td>
        </tr>
    </table>
</html:form>
<hr noshade="true">
<html:form action="/adminMajor/addCurriculum" styleId="curriculumForm">

    <table class="fields">
        <tr>
            <td align="right"><bean:message key="label.title.addCurriculum"/>:</td>
            <td></td>
        </tr>
        <tr>
            <td align="right"><bean:message key="label.career.name"/>:</td>
            <td><html:select property="majorID" styleId="curriculum" >
                            <html:option value="0">--Seleccion una careera--</html:option>
                            <html:options collection="majorList" labelProperty="majorName" property="ID_Major" />
                </html:select>
            </td>
        </tr>
        <tr>
            <td align="right"><bean:message key="label.curriculum.curriculumName"/>:</td>
            <td><html:text property="curriculumName"/> </td>
        </tr>
        <tr>
            <td align="right"><bean:message key="label.curriculum.numSemester"/>:</td>
            <td><html:text property="numSemester"/></td>
        </tr>
        <tr>
            <td></td>
            <td><html:submit titleKey="label.button.add"/></td>
        </tr>
    </table>
</html:form>


